package com.lyc.controller;

import com.lyc.dao.UserDao;
import com.lyc.service.LoginService;
import com.lyc.service.UserService;
import com.lyc.vo.LoginVo;
import com.lyc.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：Xiaochen
 * @date ：Created in 2022/11/23 23:01
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@ApiModel("登录")
@RequestMapping("/login")
@CrossOrigin//解决跨域问题
public class LoginController {
    @Autowired
    private LoginService loginService;
    @PostMapping("/login")
    @ApiOperation("登录")
    public Result login(@RequestBody LoginVo loginVo){
        Result login = loginService.login(loginVo);
        return login;
    }
}